{% extends 'resume_manage/base_information.html' %}

{% load static %}

{% block content %}
<div class="container">
    <h2>项目经历</h2>
    <form id="projects-form" method="post">
        {% csrf_token %}
        <div class="experience-item">
            <div class="form-group">
                <label for="project_name">项目名称</label>
                <input type="text" class="form-control" id="project_name" name="project_name" required value="{{ form.project_name }}">
            </div>

            <div class="form-group">
                <label for="project_role">担任角色</label>
                <input type="text" class="form-control" id="project_role" name="project_role" required value="{{ form.project_role }}">
            </div>

            <div class="form-group">
                <label for="start_date">开始时间</label>
                <input type="date" class="form-control" id="start_date" name="start_date" required value="{{ form.start_date }}">
            </div>

            <div class="form-group">
                <label for="end_date">结束时间</label>
                <input type="date" class="form-control" id="end_date" name="end_date" value="{{ form.end_date }}">
                <small class="form-text text-muted">如果是进行中的项目，请留空</small>
            </div>

            <div class="form-group">
                <label for="project_description">项目描述</label>
                <textarea class="form-control" id="project_description" name="project_description" rows="3" required>{{ form.project_description }}</textarea>
            </div>

            <div class="form-group">
                <label for="responsibilities">个人职责</label>
                <textarea class="form-control" id="responsibilities" name="responsibilities" rows="3" required>{{ form.responsibilities }}</textarea>
            </div>

            <div class="form-group">
                <label for="technologies">使用技术</label>
                <input type="text" class="form-control" id="technologies" name="technologies" value="{{ form.technologies }}">
                <small class="form-text text-muted">多个技术用逗号分隔</small>
            </div>
        </div>

        <a href="#" class="add-section" id="add-project"><i class="fas fa-plus-circle"></i> 添加项目经历</a>

        <div class="action-buttons">
            <button type="submit" class="btn btn-primary" id="save-projects">保存</button>
        </div>
    </form>
</div>

<script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
<script src="{% static 'js/projects.js' %}"></script>
{% endblock %}